#include <stdio.h>
double median(double x, double y, double z);
int main(void)
{
    double x, y, z;
    printf("输入3个数: ");
    scanf("%lf %lf %lf", &x, &y, &z);
    printf("中间数: %g\n", median(x, y, z));
    return 0;
}
double median(double x, double y, double z) {
    return x <= y ? y <= z ? y : x <= z ? z : x : z <= y ? y : x <=z ? x : z;
}